package com.warm.orm;

import com.warm.datascope.annotaion.DataScope;
import interceptor.DataScopeInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.Solon;
import org.noear.solon.core.AppContext;
import org.noear.solon.core.Plugin;

/**
 * 日志记录插件
 *
 * @author warm
 */
@Slf4j
public class XPluginImpl implements Plugin {
    @Override
    public void start(AppContext context) {
        context.cfg().loadAdd("/orm/mybatis-flex-" + Solon.cfg().env() + ".yml");
        context.cfg().setProperty("gen.genPath", "templates/table/mf");
        context.beanInterceptorAdd(DataScope.class, new DataScopeInterceptor());
        log.debug("warm插件加载: 成功加载[Mybatis-Flex集成]插件");
    }
}
